package projet;

 
import javax.swing.ImageIcon;
import javax.swing.JButton;

import java.awt.Image;
import java.io.File;
import java.io.IOException; 

import javax.imageio.ImageIO;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;

public class Bouton extends JButton {
  private String name;
  private Image img;

  public Bouton(String nom){
	    super(nom);
	    this.name = nom;
  }

 
  public void paintComponent(Graphics g){
	    Graphics2D g2d = (Graphics2D)g;
	    GradientPaint gp = new GradientPaint(0, 0, Color.white, 0, 20, Color.black, true);
	    g2d.setPaint(gp);
	    g2d.fillRect(0, 0, this.getWidth(), this.getHeight());
	    g2d.setColor(Color.LIGHT_GRAY);
	    g2d.drawString(this.name, 10, (this.getHeight() / 2) + 5);
	  }        
	}